package com.autonavi.abs.common.base;

import java.util.Date;

/**
 * @author wwy
 * @version V1.0
 * <p>Description: 数据库映射实体基类</p>
 * @date 2020-07-20 16:25
 */
public class BaseDTO {

    /**
     * 是否逻辑删除，0表示删除，1表示未删除
     */
    protected Integer deleted;
    /**
     * 记录创建人
     */
    protected String createUser;
    /**
     * 记录更新人
     */
    protected String updateUser;
    /**
     * 记录创建时间
     */
    protected Date createTime;
    /**
     * 记录更新时间
     */
    protected Date updateTime;

    /**
     * 标记新建
     *
     * @param user
     */
    protected void markNew(String user) {
        this.createUser = user;
        this.updateUser = user;
        this.createTime = new Date();
        this.updateTime = new Date();
    }

    /**
     * 标记新建
     *
     * @param user
     * @param time
     */
    protected void markNew(String user, Date time) {
        this.createUser = user;
        this.updateUser = user;
        this.createTime = time;
        this.updateTime = time;
    }

    /**
     * 标记更新
     *
     * @param user
     */
    protected void markUpdate(String user) {
        this.updateUser = user;
        this.updateTime = new Date();
    }

    /**
     * 标记更新
     *
     * @param user
     * @param time
     */
    protected void markUpdate(String user, Date time) {
        this.updateUser = user;
        this.updateTime = time;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
